<!DOCTYPE html>
<html>
<#include "../head.html">
<body class="full">
<div class="mc">
    <div class="mc-l">
        <!--左侧导航---{-->
        <div id="navPanelContainer">
            <div class="system-logo cd"></div>
            <!--管理员信息---{-->
            <#include "../adminInfo.html">
                <!--管理员信息---}-->
                <div class="nav-wrap">
                    <#include "../userinfo/left.html">
                </div>
        </div>
        <!--左侧导航---}-->
    </div>
    <div class="mc-m">
        <div class="navToggle"></div>
    </div>
    <div class="mc-r">
        <!--顶部导航---{-->
        <#include "../topNav.html">
            <!--顶部导航---}-->

            <!--面包屑导航---{-->
            <#assign moduleName="加息券管理">
                <#include "../userinfo/banner.html">
                    <!--面包屑导航---}-->

                    <!--工具栏--{-->
                    <div id="toolbar" class="clearfix">
                        <#if param??&&param.status??>
                            <#assign status=(param.get("status"))?number >
                                <#else>
                                    <#assign status=-1>
                        </#if>
                        <div class="toolbor-module export">
                            <input onclick="exportxls()" value="导出列表" class="input-button export-btn" type="button">
                        </div>
                        <div class="toolbor-module export">
                            &nbsp;&nbsp;&nbsp;加息券数量：${total?c}
                        </div>
                        <div class="toolbor-module export">
                            <div class="formTit">用户名：</div>
                            <input type="text" name="showName" id="showName" value="${showName!}"  class="search-value" placeholder="请输入用户名">
                        </div>

                        <div class="toolbor-module export">
                            <div class="formTit">投资状态：</div>
                            <div class="select-box" id="status" style="float:left;">
                                <div class="tag-select">
                                    <#if status = 0>还款中
                                        <#elseif status = 1>已还款
                                            <#else>全 部
                                    </#if>
                                </div>
                                <ul class="tag-options">
                                    <li data-value="">全  部</li>
                                    <li data-value="1" <#if status = 1>class="open-selected"</#if>>已还款</li>
                                    <li data-value="0" <#if status = 0>class="open-selected"</#if>>还款中</li>
                                </ul>
                            </div>
                        </div>

                        <div class="toolbor-module export">
                            <div class="formTit">加息券类型：</div>
                            <div class="select-box" id="type" style="float:left;">
                                <div class="tag-select">全部</div>
                                <ul class="tag-options">
                                    <li data-value="" >全部</li>
                                    <#if fList??>
                                        <#list fList as item>
                                            <li data-value="${item.id?c}" <#if item.id=type!0>class="open-selected"</#if>>${item.name}</li>
                                        </#list>
                                    </#if>
                                </ul>
                            </div>
                        </div>

                        <div class="toolbor-module export">
                            <div class="formTit">使用时间：</div>
                            <input class="_search-value" name="useStartDate" id="useStartDate" value="${useStartDate!}" onclick="change_picktime()" />
                            <div class="formTit">到</div>
                            <input class="_search-value" name="useEndDate" id="useEndDate" value="${useEndDate!}" onclick="change_picktime()" />
                        </div>

                        <div class="toolbor-module search">
                            <input type="button" value="搜索"  class="input-button" onclick="sousuo();">
                        </div>
                    </div>
                    <!--工具栏--}-->

                    <div id="main" class="clearfix">
                        <form action="" method="post">
                            <table class="data-list">
                                <tr class="header">
                                    <td>序号(ID)</td>
                                    <td>用户</td>
                                    <td>姓名</td>
                                    <td>加息券比例</td>
                                    <td>加息天数</td>
                                    <td>加息券类型</td>
                                    <td>使用金额限制</td>
                                    <td>期限限制</td>
                                    <td>投资金额</td>
                                    <td>加息收益</td>
                                    <td>投资状态</td>
                                    <td>使用时间</td>
                                </tr>
                                <#import "../../common/function.html" as func>
                                    <#list list as item>
                                        <tr class="s">
                                            <td>${item.id?c}</td>
                                            <td>${item.user.showName!}</td>
                                            <td>${item.user.realName!}</td>
                                            <td>${item.apr!}%</td>
                                            <td>
                                                <#if item.days gt 0>${item.days!}天
                                                    <#else>无限制
                                                </#if>
                                            </td>
                                            <td>${item.type.name!}</td>
                                            <td>
                                                <#if item.amountMin=0 &&item.amountMax=0>无限制
                                                    <#elseif item.amountMin=0 &&item.amountMax gt 0>最高投资${item.amountMax?c}元
                                                        <#elseif item.amountMin gt 0 &&item.amountMax=0>最低投资${item.amountMin?c}元
                                                            <#else>${item.amountMin?c}元—${item.amountMax?c}元
                                                </#if>
                                            </td>
                                            <td>
                                                <#if item.timeMin=0 &&item.timeMax=0>无限制
                                                    <#elseif item.timeMin=0 &&item.timeMax gt 0>最高期限${item.timeMax}天
                                                        <#elseif item.timeMin gt 0 &&item.timeMax=0>最低期限${item.timeMin}天
                                                            <#else>${item.timeMin}天—${item.timeMax}天
                                                </#if>
                                            </td>
                                            <td>${item.borrowTender.account?c}</td>
                                            <td>${item.borrowTender.extraAwardInterest?c}</td>

                                            <#if item.borrowTender.status==0>
                                                <td style="color:green;">还款中</td>
                                                <#elseif item.borrowTender.status==1>
                                                    <td>已还款</td>
                                                    <#else>
                                                        <td>失败</td>
                                            </#if>
                                            <td>${item.exchangeDate!"-"}</td>
                                        </tr>
                                    </#list>
                            </table>
                        </form>

                        <!--底部工具栏--{-->
                        <div id="bottomToolbar" class="clearfix">
                            <div class="other-tool">
                                <dl class="refresh-data">
                                    <dt class="refresh-data-icon"></dt>
                                    <dd><a href="javascript:void(0);" class="refresh-page">刷新数据</a></dd>
                                </dl>
                            </div>

                            <!--翻页系统--{-->
                            <div class="container s_formPage">
                                <#import "../../common/page.html" as pager>
                                    <@pager.pagination page=page url="${pageUrl}" map=param style="style1" />
                            </div>
                            <!--翻页系统--}-->
                        </div>
                        <!--底部工具栏--}-->

                        <script>
                            var url = 'couponRecordStatistics.html?search=true';
                            var xlsurl = 'couponRecordStatistics.html?export=export';
                            function sousuo(){
                                var sou = "";
                                var showName = $("#showName").val();
                                if (showName!=null&&showName!=""){
                                    sou += "&showName="+showName;
                                }
                                var type = $("#type").find(".open-selected").attr("data-value");
                                if(type!=null&&type!=""&&type!="undefine"){
                                    sou += "&type="+type;
                                }
                                var status = $("#status").find(".open-selected").attr("data-value");
                                if(status!=null&&status!=""&&status!="undefine"){
                                    sou += "&status="+status;
                                }
                                var useStartDate = $("#useStartDate").val();
                                if (useStartDate!=null&&useStartDate!=""){
                                    sou += "&useStartDate="+useStartDate;
                                }
                                var useEndDate = $("#useEndDate").val();
                                if (useEndDate!=null&&useEndDate!=""){
                                    sou += "&useEndDate="+useEndDate;
                                }
                                location.href=url+sou;
                            }
                            function exportxls(){
                                var sou = "";
                                var showName = $("#showName").val();
                                if (showName!=null&&showName!=""){
                                    sou += "&showName="+showName;
                                }
                                var type = $("#type").find(".open-selected").attr("data-value");
                                if(type!=null&&type!=""&&type!="undefine"){
                                    sou += "&type="+type;
                                }
                                var status = $("#status").find(".open-selected").attr("data-value");
                                if(status!=null&&status!=""&&status!="undefine"){
                                    sou += "&status="+status;
                                }
                                var useStartDate = $("#useStartDate").val();
                                if (useStartDate!=null&&useStartDate!=""){
                                    sou += "&useStartDate="+useStartDate;
                                }
                                var useEndDate = $("#useEndDate").val();
                                if (useEndDate!=null&&useEndDate!=""){
                                    sou += "&useEndDate="+useEndDate;
                                }
                                location.href=xlsurl+sou;
                            }
                        </script>
                    </div>
    </div>
</div>
<div class="mc-b"><#include "../foot.html"></div>
<#include "../jsPage.html">
    <script>
        var types = $("#type").find(".open-selected").text();
        if(types !=""){$("#type").find(".tag-select").text(types);}
        $("textarea.remark,.toolbor-module .search-value").unbind("focus");
    </script>
</body>
</html>
